package cn.zurish.cloud.security.controller;

import org.springframework.security.core.userdetails.User;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/users")
@CrossOrigin(
        origins = "https://your-domain.com",
        methods = {RequestMethod.GET,RequestMethod.POST},
        allowCredentials = "true",
        maxAge = 1800
)
public class UserController {
    @GetMapping
    public List<User> list() {
        return List.of(
                new User("admin", "admin", List.of()),
                new User("user", "user", List.of())
        );
    }
}
